<?php
namespace Common\Controller;
use Common\Controller\BaseController;

class AdminBaseController extends BaseController{
	/**
	 * 初始化方法
	 */
	public function _initialize(){
		parent::_initialize();

		//登录检测
		if(!session('passid')){
			$this->redirect('Admin/Login/index');
		}
		
		//权限检测
		$auth=new \Think\Auth();
		$rule_name=MODULE_NAME.'/'.CONTROLLER_NAME.'/'.ACTION_NAME;
		$result=$auth->check($rule_name,session('id'));
		if(!$result){
			echo "<span>Error：您没有权限访问</span>";
			exit;
		}
		
	}
}